package com.ws.entity.test04;

/**
 * @author 王硕
 * @version jdk21
 * @className Teacher
 * @description
 * @date 2024/11/5 20:53
 */
public class Teacher {
    // 教师的姓名
    private String name;
    // 教师的年龄
    private int age;
    // 教师的性别，true 表示男性，false 表示女性
    private boolean gender;
    // 无参构造方法
    public Teacher() {
    }
    // 接受三个参数的构造方法
    public Teacher(String name, int age, boolean gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }
    // teach方法，返回值类型为void
    public void teach() {
        System.out.println(name + " is teaching.");
    }
}
